package com.example.ccmusic

import android.content.Intent

object IntentUtils {

    fun getIntExtra(intent: Intent?, name: String, default: Int): Int {
        intent ?: return -1
        return intent.getIntExtra(name, default)
    }

    fun <T> getParcelableExtra(intent: Intent?, name: String): T? {
        intent ?: return null
        return intent.getParcelableExtra(name)
    }
}